jQuery.fn.topLink = function(settings) {
	settings = jQuery.extend({
		min: 1,
		fadeSpeed: 200,
		ieOffset: 50
	}, settings);
	return this.each(function() {
		//listen for scroll
		var el = $(this);
		el.css('display','none'); //in case the user forgot
		$(window).scroll(function() {
			if(!jQuery.support.hrefNormalized) {
				el.css({
					'position': 'absolute',
					'top': $(window).scrollTop() + $(window).height() - settings.ieOffset
				});
			}
			if($(window).scrollTop() >= settings.min)
			{
				el.fadeIn(settings.fadeSpeed);
			}
			else
			{
				el.fadeOut(settings.fadeSpeed);
			}
		});
	});
};

$(function(){
	/*$('#countdown').countdowntimer({
		minutes :40,
		seconds : 00,
		size : "lg"
	});*/
	
	/*-----------------------------------------------------------------------------------*/
	/*	Scroll body to 0px on click
	/*-----------------------------------------------------------------------------------*/
	
	if ( jQuery().scrollTop ) {
		
		$('#back-to-top').topLink({
			min: 130,
			fadeSpeed: 500
		});
		
		//smoothscroll
		$('#back-to-top').click(function(e) {
			e.preventDefault();
			$.scrollTo(0, 0, { easing: 'easeOutCubic' });
		});
	
	}
});



